package com.turing.post.account.util;

import java.math.BigInteger;
import java.util.Date;

import javax.ejb.Local;
import javax.ejb.Remote;

import com.turing.post.organization.util.IssueCompany;
import com.turing.post.util.PCPSApplicationException;

/**
 * 子帐户业务接口
 * 
 * @author yxb 2012.12.18
 */
@Remote
@Local
public interface SubAccountBusiness {
	/**
	 * 创建子帐户
	 * 
	 * @param masterAccNo
	 *            主帐号
	 * @param openBranchNo
	 *            开户机构号
	 * @param openTime
	 *            开户时间
	 * @param salesGroupId
	 *            销售员组ID
	 * @return 子帐户号
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public BigInteger createSubAccount(BigInteger masterAccNo,
			String openBranchNo, Date openTime, BigInteger salesGroupId)
			throws PCPSApplicationException;

	/**
	 * 创建子帐户
	 * 
	 * @param masterAccNo
	 *            主帐号
	 * @param openBranchNo
	 *            开户机构号
	 * @param openTime
	 *            开户时间
	 * @param appSeqNo
	 *            应用顺序号
	 * @return 子帐户号
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public BigInteger createAppManageSubAccount(BigInteger masterAccNo,
			String openBranchNo, Date openTime, String appSeqNo)
			throws PCPSApplicationException;

	/**
	 * 更新子帐户余额
	 * 
	 * @param subAccNo
	 *            子帐号
	 * @param amount
	 *            发生额
	 * @param accTime
	 *            记帐时间
	 * @return 更新后余额
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public BigInteger updateBalance(BigInteger subAccNo, BigInteger amount,
			Date accTime) throws PCPSApplicationException;

	/**
	 * 账户子系统记账
	 * 
	 * @param cardNo
	 * @param amount
	 * @param remark
	 * @param issueCompany
	 * @param tranTime
	 * @param localSeqNo
	 * @return
	 * @throws PCPSApplicationException
	 */
	public String insertSubAccountInfo(String cardNo, BigInteger amount,
			String remark, IssueCompany issueCompany, Date tranTime,
			String localSeqNo) throws PCPSApplicationException;
}
